Part Number Hot Search : 
TEA2031A 10500 XFATM SJ6553 9W320FBT STG3384 12232 F05RD
Product Description
Full Text Search
 

To Download AN10397 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  AN10397 how to use the sc18im700 to control any i 2 c-bus device rev. 01 ? 5 december 2005 application note document information info content keywords i2c, i2c controller, master i2c, uart abstract this application note shows how the sc18im700 can be used in a system to control other i 2 c-bus slave devices.
AN10397_1 ? koninklijke philips electronics n.v. 2005. all rights reserved. application note rev. 01 ? 5 december 2005 2 of 10 philips semiconductors AN10397 how to use the sc18im700 to control any i 2 c-bus device contact information for additional information, please visit: http://www.semiconductors.philips.com for sales office addresses, please send an email to: sales.addresses@www.semiconductors.philips.com revision history rev date description 01 20051205 application note; initial version.
AN10397_1 ? koninklijke philips electronics n.v. 2005. all rights reserved. application note rev. 01 ? 5 december 2005 3 of 10 philips semiconductors AN10397 how to use the sc18im700 to control any i 2 c-bus device 1. introduction philips semiconductors recently introduced a whole new family of devices called ?the bridges?. these devices are intended to transform data from one serial bus to another serial bus, and this transformation allows the host to control devices that have serial host bus interfaces that are not native to the system. one such scenario is the i 2 c-bus interface. there are wide ranges of devices that have an i 2 c-bus interface to communicate with a host. some of such devices are: eeproms, temperature sensors, analog-to-digital or digital-to-analog converters, led blinkers and i/o expanders. to use these devices in the system, a host must have an integrated i 2 c-bus controller on-board, or it must have an external, stand-alone i 2 c-bus controller. philips semiconductors? sc18im700?an i 2 c-bus controller with a uart host interface? is the perfect choice in the case where the host does not have an integrated i 2 c-bus controller on-board, and the syst em designer wishes to use i 2 c-bus related devices in the system. the sc18im700 does not require any programming at all other than the code to write and read from the host?s uart port. this non-programming is possible because sc18im700 communicates with the host through a series of messages that are based on ascii characters. this application note shows how a host can control, setup, read and write to any i 2 c-bus devices through this uart-to-i 2 c controller. the examples used in this application note are built around an led blinker from philips semiconductors, the pca9531. besides the i 2 c-bus control function, the sc18im700 also contains a general-purpose 8-bit programmable i/o port. these eight general purpose i/o pins can be configured to the following modes: input only, open-drain output, push-pull output or quasi-bidirectional input/output. 2. pca9531: led blinker the pca9531 is an 8-bit i 2 c-bus and smbus i/o expander optimized for dimming leds in 256 discrete steps for red/green/blue (rgb) color mixing and backlight applications. the initial setup sequence programs the two blink rates and duty cycles for each individual pwm. from then on, only one command from the bus master is required to turn individual leds on, off, blink rate 1 or blink rate 2. based on the programmed frequency and duty cycle, blink rate 1 and blink rat e 2 will cause the leds to appear at a different brightness or blink at periods up to 1.69 second. the open-drain outputs directly drive the leds with maximum output sink current of 25 ma per bit and 100 ma per package. please refer to the pca9531 data sheet for more detail about this device and its internal registers? usage. the following steps to program the part are extracted from the example in the data sheet, page 11.
AN10397_1 ? koninklijke philips electronics n.v. 2005. all rights reserved. application note rev. 01 ? 5 december 2005 4 of 10 philips semiconductors AN10397 how to use the sc18im700 to control any i 2 c-bus device 2.1 programming example the following example will show how to set le d0 to led3 on. it will then set led4 and led5 to blink at 1 hz at a 50 % duty cycle. led6 and led7 will be set to be dimmed at 25 % of their maximum brightness (duty cycle = 25 %). [1] this column shows the steps needed to be performed by the host to set the led to blink at a specified rate. table 1: pca9531 programming example programming step i 2 c-bus data [1] start s pca9531 address with a0, a1, a2 = low c0h psc0 subaddress + auto-increment 11h set prescaler psc0 to achieve a period of 1 second: psc0 = 151 97h set pwm0 duty cycle to 50 %: pwm0 = 128 80h set prescaler pcs1 to dim at maximum frequency: psc1 = 0 00h set pwm1 output duty cycle to 25 %: pwm1 = 64 40h set led0 to led3 on 55h set led4, led5 to pwm0, and led6, led7 to pwm1 fah stop p blink period 1 psc0 1 + 152 ---------------------- - == pwm0 256 ---------------- - 0.5 = blink period max = pwm1 256 ---------------- - 0.25 =
AN10397_1 ? koninklijke philips electronics n.v. 2005. all rights reserved. application note rev. 01 ? 5 december 2005 5 of 10 philips semiconductors AN10397 how to use the sc18im700 to control any i 2 c-bus device 3. sc18im700: uart to i 2 c-bus controller the sc18im700 is designed to serve as an interface between a standard uart of a microcontroller/microprocessor and the serial i 2 c-bus. this allows the microcontroller/microprocessor to communicate directly with other i 2 c-bus devices. the sc18im700 can operate as an i 2 c-bus master and can be a transmitter or a receiver. the sc18im700 controls all the i 2 c-bus specific sequences, protocol, arbitration and timing. the host communicates with the sc18im700 with ascii messages protocol; this makes the control sequences from host to sc18im700 become very simple. the host initiates i 2 c-bus data transfer, read from and write to sc18im700 internal registers through a series of ascii commands. table 2 lists the ascii commands supported by sc18im700, and also their hex value representation. unrecognized commands are ignored by the device. please refer to the sc18im700 data sheet for more descriptive detail of the above commands. 4. using the sc18im700 to control the pca9531 the ?s? command can be used to setup the pca9531?s internal registers to blink the led at specified frequency and rate. the format for the ?s? command is shown in figure 2 . table 2: ascii commands supported by the sc18im700 ascii command hex value command function s0x53i 2 c-bus start command p0x50i 2 c-bus stop command r 0x52 read sc18im700 internal register command w 0x57 write to sc18im700 internal register command i 0x49 read gpio port command o 0x4f write to gpio port command z 0x5a power-down fig 1. sc18im700 controlling the pca9531 fig 2. ?s? command format uart 002aab967 host uart sc18im700 i 2 c-bus master tx rx pca9531 sda scl number of bytes s char. slave adr. + w data 0 data n p char.
AN10397_1 ? koninklijke philips electronics n.v. 2005. all rights reserved. application note rev. 01 ? 5 december 2005 6 of 10 philips semiconductors AN10397 how to use the sc18im700 to control any i 2 c-bus device the command begins with an ?s? character as th e first byte, the second byte specifies the i 2 c-bus slave address of the i 2 c-bus device, where ?w? is the le ast significant bit and it is set to a logic 0. the third byte indicates the number of data bytes in the message (data 1 to data n), and the last byte ended with the ?p? character. to turn on and blink the led, the host would send a message to the sc18im700 as follows: sc007119780004055fap . once the sc18im700 receives this message from host it will translate and will send the same message through the i 2 c-bus to the pca9531. the led should be now blinking. if the host wishes to read the pca9531 internal registers to make sure they are correctly set after the host has written to them, the ?read after write? command can be used for that purpose. the format for the ?read after write? command is as shown in figure 3 . using the first example the host sends the following message to the sc18im700: sc007119780004055fa sc107p sc18im will send the message to pca9531, then will read seven bytes from pca9531 and sends them to the host automatically. t he host will receive the following byte from sc18im700 through its uart port: 11 97 80 00 40 55 fa the host can also ask sc18im700 to automatically send an i 2 c-bus? transaction status information to the host after sc18im700 has sent the host?s message to an i 2 c-bus slave. the host can do this by sending a ?register read? command to read the i2cstatus register after any normal i 2 c-bus message. using the above example, the host would send the following message to sc18im700: sc007119780004055fap r0ap once the message is sent to the i 2 c-bus device at address 0xc0, sc18im700 will send the i2c_ok (hex code 0xf0) status to the host. see ta bl e 9 of the data sheet for other i2c status code. upon receiving the i2c_ok status the host can send another message to sc18im700. fig 3. ?read after wr ite? command format number of bytes s char. slave adr. + w data 1 data n s char. number of bytes slave adr. + r p char.
AN10397_1 ? koninklijke philips electronics n.v. 2005. all rights reserved. application note rev. 01 ? 5 december 2005 7 of 10 philips semiconductors AN10397 how to use the sc18im700 to control any i 2 c-bus device 5. using the 8-bit programmable gpio port gpio 0 to gpio 7 ports may be configured by the host to one of four types. these are: quasi-bidirectional, push-pull, open-drain, and input-only. two bits are used to select the desired configuration for each port pin. portconf1 is used to select the configuration for gpio[3:0], and portconf2 is used to select the configuration for gpio[7:4]. each port pin has schmitt triggered input that also has a glitch suppression circuit. normally to read the actual state of the input pins the host must read the iostate register, or to write to any of the output pins the host would perform a write to the iostate register. but, there are two commands that can be used to simplify the process of controlling the gpio port: they are the ?i? and the ?o? commands. instead of reading and writing to the iostate register, the host would send these two commands in form of a message. let?s say gpio0 to gpio3 are programmed as inputs, and gpio4 to gpio7 are programmed as outputs, and the host wants to read the state of all of the input pins and to set all the output pins to 1. to read the input pins the host sends this message to sc18im700: ip the sc18im700 will return a byte to the host th rough the uart port, bit 3 to bit 0 of this byte indicate the actual state of the input pins; bit 7 to bit 4 indicate the actual state of the output pins. to set the output pins, the host sends this message to sc18im700: ofxp where the ?x? can be any value and will not ha ve any effect because gpio3 to gpio0 are programmed as inputs. gpio7 to gpio4 should all go high once this message is sent. table 3: port configurations iox.1 iox.0 port configuration 0 0 quasi-bidirectional output configuration 0 1 push-pull output configuration 1 0 input-only configuration 1 1 open-drain output configuration
AN10397_1 ? koninklijke philips electronics n.v. 2005. all rights reserved. application note rev. 01 ? 5 december 2005 8 of 10 philips semiconductors AN10397 how to use the sc18im700 to control any i 2 c-bus device 6. conclusion as shown in the previous examples, the sc18im700 can be used to control any i 2 c-bus device. this device does not require any programming at all because the commands are sent from a host in the form of ascii characters. the 8-bit general purpose programmable port offers the system great flexibility, and th e device can be used as an expandable 8-bit port with a uart interface. 7. abbreviations table 4: abbreviations acronym description ascii american standard code for information interchange eeprom electrically erasable programmable read only memory gpio general purpose input/output i 2 c-bus inter ic bus led light emitting diode pwm pulse width modulator smbus system management bus uart universal asynchronous receiver/transmitter
philips semiconductors AN10397 how to use the sc18im700 to control any i 2 c-bus device AN10397_1 ? koninklijke philips electronics n.v. 2005. all rights reserved. application note rev. 01 ? 5 december 2005 9 of 10 8. disclaimers life support ? these products are not designed for use in life support appliances, devices, or systems wher e malfunction of these products can reasonably be expected to result in personal injury. philips semiconductors customers using or selling these products for use in such applications do so at their own risk and agree to fully indemnify philips semiconductors for any damages resulting from such application. right to make changes ? philips semiconductors reserves the right to make changes in the products - including circuits, standard cells, and/or software - described or contained herein in order to improve design and/or performance. when the product is in fu ll production (status ?production?), relevant changes will be communicated via a customer product/process change notification (cpcn). philips semiconductors assumes no responsibility or liability for the use of any of these products, conveys no licence or title under any patent, copyright, or mask work right to these products, and makes no representations or warranties that these products are free from patent, copyright, or mask work right infringement, unless otherwise specified. application information ? applications that are described herein for any of these products are for illustrative purposes only. philips semiconductors make no representation or warranty that such applications will be suitable for the specified use without further testing or modification. 9. trademarks notice ? all referenced brands, product names, service names and trademarks are the property of their respective owners. i 2 c-bus ? logo is a trademark of koninklijke philips electronics n.v.
? koninklijke philips electronics n.v. 2005 all rights are reserved. reproduction in whole or in part is prohibited without the prior written consent of the copyright owner. the information presented in this document does not form part of any quotation or contract, is believed to be accurate and reliable and may be changed without notice. no liability will be accepted by the publisher for any consequence of its use. publication thereof does not convey nor imply any license under patent- or other industrial or intellectual property rights. date of release: 5 december 2005 document number: AN10397_1 published in the netherlands philips semiconductors AN10397 how to use the sc18im700 to control any i 2 c-bus device 10. contents 1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 pca9531: led blinker . . . . . . . . . . . . . . . . . . . . 3 2.1 programming example . . . . . . . . . . . . . . . . . . . 4 3 sc18im700: uart to i 2 c-bus controller . . . . . 5 4 using the sc18im700 to control the pca9531 5 5 using the 8-bit programmable gpio port . . . . 7 6 conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 7 abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 8 disclaimers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 9 trademarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9


▲Up To Search▲   

 
Price & Availability of AN10397

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X